package com.itheima.homework.Three;

import java.util.Set;
import java.util.TreeSet;

/*
* * 需求 :  创建一个电脑类，有品牌、价格、颜色三个属性
 * 创建5个电脑对象，往TreeSet集合中添加，并按照价格从高到低进行排序
 * */
public class Demo {
    public static void main(String[] args) {

        Computer c1 = new Computer("z",1000,"y");
        Computer c2 = new Computer("z",1000,"h");
        Computer c3 = new Computer("z",4000,"t");
        Computer c4 = new Computer("z",2500,"d");
        Computer c5 = new Computer("z",3600,"q");


        Set<Computer> set = new TreeSet<Computer>();

        set.add(c1);
        set.add(c2);
        set.add(c3);
        set.add(c4);
        set.add(c5);



        System.out.println(set);



    }
}
